/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.RechargeType;
import com.qinyetech.springstage.core.entity.AbstractEntity;

import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Builder;
import lombok.experimental.Tolerate;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * ClassName: RechargeRule <br/>
 * Function: 充值规则 <br/>
 * date: 2018-12-04 09:40:32 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="recharge_rules")
public class RechargeRule extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 会员卡类型 
    @Column(name="category_id")
	private Long categoryId = null;

	// 规则类型
	@Column(name="type", length = 300)
	@Enumerated(EnumType.STRING)
	private RechargeType type = null;

	// 充值开始金额 
    @Column(name="range_start",scale=2)
	private Double rangeStart = null;

	// 充值结束金额 
    @Column(name="range_end",scale=2)
	private Double rangeEnd = null;

	// 赠送金额 
    @Column(name="gift_money",scale=2)
	private Double giftMoney = null;

	// 赠送积分 
    @Column(name="gift_point",scale=2)
	private Double giftPoint = null;


    @Tolerate
	public RechargeRule() {
		
	}
    @Tolerate
	public RechargeRule(Long id){
    	super.setId(id);
    }
	
	/**
	 * 获取会员卡类型
	 */
	public Long getCategoryId() {
		return this.categoryId;
	}

    /**
     * 设置会员卡类型
     */
	public RechargeRule setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
		return this;
	}


	/**
	 * 获取充值开始金额
	 */
	public Double getRangeStart() {
		return this.rangeStart;
	}

    /**
     * 设置充值开始金额
     */
	public RechargeRule setRangeStart(Double rangeStart) {
		this.rangeStart = rangeStart;
		return this;
	}

	/**
	 * 获取充值结束金额
	 */
	public Double getRangeEnd() {
		return this.rangeEnd;
	}

    /**
     * 设置充值结束金额
     */
	public RechargeRule setRangeEnd(Double rangeEnd) {
		this.rangeEnd = rangeEnd;
		return this;
	}

	/**
	 * 获取赠送金额
	 */
	public Double getGiftMoney() {
		return this.giftMoney;
	}

    /**
     * 设置赠送金额
     */
	public RechargeRule setGiftMoney(Double giftMoney) {
		this.giftMoney = giftMoney;
		return this;
	}

	/**
	 * 获取赠送积分
	 */
	public Double getGiftPoint() {
		return this.giftPoint;
	}

    /**
     * 设置赠送积分
     */
	public RechargeRule setGiftPoint(Double giftPoint) {
		this.giftPoint = giftPoint;
		return this;
	}

	public RechargeType getType() {
		return type;
	}

	public void setType(RechargeType type) {
		this.type = type;
	}
}
